
package hasthi.metamodel;

import javax.xml.namespace.QName;

public class ChangeEvent {
    public static enum ChangeType{Update,AddNew,Remove};
    
    private QName resourceID;
    private long timestamp;
    private QName propertyName;
    private Object newValue;
    private ChangeType changeType;
    
    public QName getResourceID() {
        return resourceID;
    }
    public Object getNewValue() {
        return newValue;
    }
    public QName getPropertyName() {
        return propertyName;
    }
    public long getTimestamp() {
        return timestamp;
    }
    
    
    
    public ChangeType getChangeType() {
        return changeType;
    }
    public ChangeEvent(QName id, long timestamp, QName propertyName, String newValue) {
        this(ChangeType.Update,id,timestamp,propertyName,newValue);
    }
    
    public ChangeEvent(ChangeType type,QName id, long timestamp, QName propertyName, Object newValue) {
        this.changeType = type;
        this.resourceID = id;
        this.timestamp = timestamp;
        this.propertyName = propertyName;
        this.newValue = newValue;
    }
    
    public ChangeEvent(ChangeType type,QName id, long timestamp) {
        this.changeType = type;
        this.resourceID = id;
        this.timestamp = timestamp;
    }
    
}

